package com.hunter.jerrymouse.annotation.response;

import java.lang.annotation.*;

/**
 * Created by hunter
 * <p>
 * 响应注解
 */
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface ResponseData {

    /**
     * 响应体格式
     *
     * @return
     */
    ContentType contentType() default ContentType.DEFAULT;

    /**
     * 请求方法枚举
     */
    enum ContentType {

        DEFAULT("text/plain"),
        TEXT_PLAIN("text/plain"),
        APPLICATION_JSON("application/json");
        /*
         * .
         * .
         * other
         */

        private String name;

        ContentType(String name) {
            this.name = name;
        }

        public String getName() {
            return name;
        }
    }
}
